<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="8">
        <div class="block">
          <span>默认Hover指示器触发</span>
          <el-carousel height="150px" :interval="1000">
            <el-carousel-item v-for="item in 4" :key="item">
              <h3>{{ item }}</h3>
            </el-carousel-item>
          </el-carousel>
        </div>
      </el-col>

      <el-col :span="8">
        <div class="block">
          <span>click指示器触发</span>
          <el-carousel trigger="click" direction="vertical" height="150px">
            <el-carousel-item v-for="item in 4" :key="item">
              <h3>{{ item }}</h3>
            </el-carousel-item>
          </el-carousel>
        </div>
      </el-col>

      <el-col :span="8">
        <div class="block">
          <span>指示器在外部</span>
          <el-carousel height="150px" indicator-position="outside" arrow="always">
            <el-carousel-item v-for="item in 4" :key="item">
              <h3>{{ item }}</h3>
            </el-carousel-item>
          </el-carousel>
        </div>
      </el-col>
    </el-row>

    <el-row>
      <div class="block">
        <el-carousel :interval="2000" type="card" height="150px">
          <el-carousel-item v-for="item in 6" :key="item">
            <h3>{{ item }}</h3>
          </el-carousel-item>
        </el-carousel>
      </div>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  }
}
</script>

<style scoped>
.el-row, h4 {
  margin-top: 20px;
}

.block {
  text-align: center;

}

.el-carousel__item h3 {
  color: #fdfffd;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
  background-color: #d3dce6;
}
</style>